Graphing Translations and Inequalities

Central Magnet School

Lesson Overview

The student will learn about

Graphing Inequalities

Horizontal and Vertical Translations

Stretching

parameters={a,c,d,x}

Parent Functions

A Parent Function is the simplest form of any graph/function. 
For example, the parent function of y=3(Sqrt[x+2])-5   is   y=(Sqrt[x]). The parent function of y=2x+1   is y=x.

Journal: Try to match each function with its parent function. 


({{y=4(((x+6))^3)-3  }, {y=4log(x+1)+5}, {y=2(e^(x+1))-4}, {y=(1/(x+3))-4}, {y=3(x^4)-5}, {y=4sin(x+(π/2))-3}, {y=6x-5}, {y=3|x-5|+2}})                       ({{y=(1/x)}, {y=(e^x)}, {y=sin(x)}, {y=(x^4)}, {y=(x^3)}, {y=x}, {y=|x|}, {y=log(x)}})

Transformations

Start with the linear parent function and change each slider (a-d) to visualize how each one changes the graph.

Manipulate[
If[xmin==xmax,If[xmax≥7,xmin=xmax-.01,xmax=xmin+.01]];
Module[{function,buttonText,g1,g2,lk},
If[reset==True,{a,b,c,d,xmin,xmax}={1,1,0,0,-7,7};reset=False;inverse=False; ShowParentFunction=True];
buttonText={"linear","quadratic","cubic","absolute value","square root","piecewise","exponential","logarithmic","sine","cosine", "tangent", "inverse sine", "inverse cosine", "inverse tangent"};
buttonText= Style[#,FontFamily->"Times"]& /@ buttonText;
functionButtons =Map[#[[1]]-> #[[2]]&,Transpose[{Range[Length[buttonText]],buttonText}]];
function[x_]:={x,(x^2),(x^3),Abs[x],Sqrt[x],Piecewise[{{2,x<-2},{-x+2,-2≤ x <1},{Sqrt[x],1<=x<4},{(x-3)^2,x≥4}}],Exp[x],Log[x],Sin[x],Cos[x],Tan[x],ArcSin[x],ArcCos[x],ArcTan[x]};
g1=Graphics[Plot[a*function[b(x+c)][[fff]]+d,{x,xmin,xmax},Exclusions-> If[fff==11,Cos[b(x+c)]==0],ExclusionsStyle-> Directive[Blue,Dashed],PlotRange->All]];
g2=Graphics[Plot[function[x][[fff]],{x,-7,7},Exclusions-> If[fff==11,Cos[x]==0],ExclusionsStyle-> Directive[Red,Dashed],PlotRange -> All, PlotStyle->{Red,AbsoluteThickness[1]}]];
Show[g1,If[inverse==True,Plot[x,{x,-7,7},PlotStyle->{Black,Dashed}],{}],If[inverse==True||ShowParentFunction==False,{},g2],
If[inverse==True,g1/.L_Line:>{Red,GeometricTransformation[L,ReflectionTransform[{-1,1}]]},{}],
PlotRange->{{-7,7},{-7,7}},
Axes->True,
Ticks->{If[fff==9||fff==10||fff==11,Range[-2Pi,2Pi,Pi/4],Automatic]},
ImageSize->{375,375},
AxesStyle->AbsoluteThickness[If[MemberQ[options,grid],1.25,1]],
AxesOrigin->Automatic, 
AxesLabel->{Style["x",Italic],Style["y",Italic]},
PlotLabel-> If[MemberQ[options,pl],Grid[{{If[inverse==True,ToString[Style[HoldForm[g]"\!\(\*SuperscriptBox[\(\\ \), \(-1\)]\)"[HoldForm[x]],Red],TraditionalForm],If[ShowParentFunction==False," ",StringJoin[{ToString[Style[HoldForm[f][HoldForm[x]],Red],TraditionalForm],ToString[Style[" = ",Red],TraditionalForm],ToString[Style[function[x][[fff]],Red],TraditionalForm]
}]]]},
{
If[ShowParentFunction==False||inverse==True,
lk=StringJoin[{ToString[Style[HoldForm[g][HoldForm[x]],Blue],TraditionalForm],ToString[Style[" = ",Blue],TraditionalForm], 
ToString[Style[If[Round[a,.1]==1.,1,If[Round[a,.1]==0.,0,a]] (function[If[Round[b,.1]==1.,1,If[Round[b,.1]==0.,0,b]](HoldForm[x]+
If[fff==9||fff==10||fff==11,Pi*Rationalize[If[Round[c/Pi,.05]==0.,0,Round[c/Pi,.05]]],If[Round[c,.1]==0.,0,c]])][[fff]]
)+If[Round[d,.1]==0.,0,d],Blue],TraditionalForm]}],
lk=StringJoin[{ToString[Style[HoldForm[g][HoldForm[x]],Blue],TraditionalForm],ToString[Style[" = ",Blue],TraditionalForm], 
ToString[Style[If[Round[a,.1]==1.,1,If[Round[a,.1]==0.,0,a]] HoldForm[f][If[Round[b,.1]==1.,1,If[Round[b,.1]==0.,0,b]](HoldForm[x]+
If[fff==9||fff==10||fff==11,Pi*Rationalize[If[Round[c/Pi,.05]==0.,0,Round[c/Pi,.05]]],If[Round[c,.1]==0.,0,c]]
)]+If[Round[d,.1]==0.,0,d],Blue],TraditionalForm]}]
]
},
{" "
}
}
]],
ImageMargins->5,
GridLines->If[MemberQ[options,grid],{Range[-6,6],Range[-6,6]},None],AspectRatio->1
]],
Delimiter,
Text[Row[{Style["g",Italic],"(",Style["x",Italic],")","=",Style["a",Italic], Style["f",Italic],"(",Style["b",Italic],"(",Style["x",Italic],"+",Style["c",Italic],")) +",Style["d",Italic]}]],
{{a,1},-7,7,.05,Appearance->"Labeled",ImageSize->Tiny},
{{b,1},-7,7,.05,Appearance->"Labeled",ImageSize->Tiny},
{{c,0},-7,7,.05,Appearance->"Labeled",ImageSize->Tiny},
{{d,0},-7,7,.05,Appearance->"Labeled",ImageSize->Tiny},
{{xmin,-7},-7,7,.05,Appearance->"Labeled",ImageSize->Tiny},
{{xmax,7},-7,7,.05,Appearance->"Labeled",ImageSize->Tiny},
Delimiter,
{{inverse,False,"inverse"},{False,True}},
{{ShowParentFunction,True,"parent function"},{False,True}},
Delimiter,
{{fff,1," "},functionButtons,ControlType->PopupMenu},
Delimiter,
{{reset,False,"reset"},{False,True}},
Delimiter,
{{options,{pl},""},{pl->"plot label",grid->"grid lines"},
ControlType->CheckboxBar,Appearance->"Vertical"},
{{functionButtons,{}},ControlType->None},
ControlPlacement->Left,
AutorunSequencing->{4,3,2,1}]

Journal: Generalize how c and d change the graph from the original parent function. Sliders a and b have the same effect in linear functions. Is this always true? Explain.

General Notation

As you learned for the absolute value case: y=a|x-h|+k,  a changes the slope/direction, h shifts left/right opposite, and k shifts up/down.

This idea actually holds true for any function:

a f(x) where a changes the slope (stretches) of the parent function

f( x+h ) where h shifts the parent function left or right opposite of what you would think

f(x) + k where k shifts the parent function up or down exactly like you would think

For example: y=2(((x+3))^2)+4 where 2 makes the parent function skinner, the 3 shifts the graph 3 to the left, and the 4 shifts it up 4 units as you see below.

The parent function y=(x^2) is in light blue and the translated function is in dark blue.

Manipulate[Plot[{a(((x+h))^2)+k,(x^2)},{x,-10,10},PlotRange->{-10,10},AspectRatio->Automatic,PlotStyle->{Thick,Blue}],{{a,2},-10,10,.5,Appearance->"Labeled"},{{h,3},-10,10,1,Appearance->"Labeled"},{{k,4},-10,10,1,Appearance->"Labeled"}]

Journal: Create a function that opens downward with a vertex at (5,2). Write down the function in vertex form: y=((a(x+h))^2)+k.

Graphing Inequalities

Try different situations with the slides and try switching to greater than by selecting the checkbox.

(Subscript[ineq, 1]) = False;
(Subscript[ineq, 2]) = False;
(Subscript[ineq, 3]) = False;
Manipulate[RegionPlot[{
If[(Subscript[ineq, 1]),y>(Subscript[m, 1]) x + (Subscript[b, 1]),y<(Subscript[m, 1]) x + (Subscript[b, 1])],
If[(Subscript[ineq, 2]),y>(Subscript[m, 2]) x + (Subscript[b, 2]),y<(Subscript[m, 2]) x + (Subscript[b, 2])],
If[(Subscript[ineq, 3]),y>(Subscript[m, 3]) x + (Subscript[b, 3]),y<(Subscript[m, 3]) x + (Subscript[b, 3])]},
{x,-10,10},{y,-10,10},PerformanceGoal->"Quality",Axes-> True, 
PlotLabel-> Style[Column[{
Row[{"(Subscript[y, 1]) ",If[(Subscript[ineq, 1]),"> ","< "],If[(Subscript[m, 1])<0,"","  "],ToString[NumberForm[(Subscript[m, 1]),{3,2}]] ," (Subscript[x, 1])",If[(Subscript[b, 1])<0," - "," + "], ToString[NumberForm[Abs[(Subscript[b, 1])],{3,2}]]}],
Row[{"(Subscript[y, 2]) ",If[(Subscript[ineq, 2]),"> ","< "],If[(Subscript[m, 2])<0,"","  "],ToString[NumberForm[(Subscript[m, 2]),{3,2}]] ," (Subscript[x, 2])",If[(Subscript[b, 2])<0," - "," + "], ToString[NumberForm[Abs[(Subscript[b, 2])],{3,2}]]}],
Row[{"(Subscript[y, 3]) ",If[(Subscript[ineq, 3]),"> ","< "],If[(Subscript[m, 3])<0,"","  "],ToString[NumberForm[(Subscript[m, 3]),{3,2}]] ," (Subscript[x, 3])",If[(Subscript[b, 3])<0," - "," + "], ToString[NumberForm[Abs[(Subscript[b, 3])],{3,2}]]}]
}],"Label",12],ImageSize->{400,400}],
Style["(Subscript[y, 1])",Blue,16],
{{(Subscript[m, 1]),1,"(Subscript[m, 1])"},-5.,5.,1,Appearance-> "Labeled", ImageSize-> Tiny},
{{(Subscript[b, 1]),0,"(Subscript[b, 1])"},-5.,5.,1,Appearance-> "Labeled", ImageSize-> Tiny},
Row[{"switch to >",Checkbox[Dynamic[(Subscript[ineq, 1]),Initialization-> False],{False,True}]}],
Delimiter,
Style["(Subscript[y, 2])",Blue,16],
{{(Subscript[m, 2]),3,"(Subscript[m, 2])"},-5.,5.,1,Appearance-> "Labeled", ImageSize-> Tiny},
{{(Subscript[b, 2]),2,"(Subscript[b, 2])"},-5.,5.,1,Appearance-> "Labeled", ImageSize-> Tiny},
Row[{"switch to >",Checkbox[Dynamic[(Subscript[ineq, 2]),Initialization-> False],{False,True}]}],
Delimiter,
Style["(Subscript[y, 3])",Blue,16],
{{(Subscript[m, 3]),-3,"(Subscript[m, 3])"},-5.,5.,1,Appearance-> "Labeled", ImageSize-> Tiny},
{{(Subscript[b, 3]),1,"(Subscript[b, 3])"},-5.,5.,1,Appearance-> "Labeled", ImageSize-> Tiny},
Row[{"switch to >",Checkbox[Dynamic[(Subscript[ineq, 3]),Initialization-> False],{False,True}]}],
AutorunSequencing -> {1,2,5,6},SaveDefinitions-> True]

Journal: Change the sliders to (2, -3, -2, 1, 3, -5) and write down two points that would satisfy the system. Check by plugging in.

Quadratic Inequalities

As you learned in the last notebook: y=((a(x-h))^2)+k, where a changes the slope/direction, h shifts left/right opposite, and k shifts up/down.

We can create some interesting inequality graphs with quadratic functions. You may have to click start over to begin.

First, change the sliders. Then, select the inequality you want for the blue line and click inside the region where the shading should go and hit shade. Then repeat for the red line and hit check to see if you selected the right area to shade.

Manipulate[
dashing1=Switch[ineq1,"<",0.03,"≤",0,"≥",0,">",0.03];
Plot1=Plot[m1 (((x+h1))^2) + b1,{x,-13,13},Filling->filling1,FillingStyle->{{Blue,Opacity[0.5]},{Blue,Opacity[0.5]}},PlotStyle->{Dashing->dashing1,Blue},PlotRange->13,
PlotLabel-> Column[
{
Style[Row[{"y ",ineq1,If[m1<0,"","  "],ToString[m1] ," (x",If[h1<0," - "," + "], ToString[Abs[h1]],")^2",If[b1<0," - "," + "], ToString[Abs[b1]]}],{Blue,18}],
Style[Row[{"y ",ineq2,If[m2<0,"","  "],ToString[m2] ," (x",If[h2<0," - "," + "], ToString[Abs[h2]],")^2",If[b2<0," - "," + "], ToString[Abs[b2]]}],{Red,18}]
}
]];
dashing2=Switch[ineq2,"<",0.03,"≤",0,"≥",0,">",0.03];
testfilling1=Switch[filling1,
None,False,
Top,Switch[ineq1,">",True,"≥", True,"<",False,"≤",False],
Bottom,Switch[ineq1,"<",True,"≤", True,">",False,"≥",False]
];
testfilling2=Switch[filling2,
None,False,
Top,Switch[ineq2,">",True,"≥", True,"<",False,"≤",False],
Bottom,Switch[ineq2,"<",True,"≤", True,">",False,"≥",False]
];
Plot2=Plot[m2((( x+h2))^2) + b2,{x,-13,13},Filling->filling2,
FillingStyle->{{Red,Opacity[0.5]},{Red,Opacity[0.5]}},PlotStyle->{Dashing->dashing2,Red},
PlotStyle->Dashed,PlotRange->13];
If[showresult,
Graphics[Text[Style[If[testfilling1&&testfilling2,"Good Job!","Try Again"],36]],ImageSize->{500,300}],
Show[Plot1,Plot2,Graphics[Text["("<>ToString[pt[[1]]]<>","<>ToString[pt[[2]]]<>")",pt,{-2,0}]],PlotRange->13,ImageSize->{500,300}]
],
{{pt,{0,0}},{-10,-10},{10,10},{1,1},Locator},
Grid[{{"                                                                    ",
Button[Style["Check",Bold],showresult=True,Background->Green],
Button[Style["Start Over",Bold],showresult=False;filling1=None;filling2=None,Background->Red]}}],
Grid[
{
{
"blue a",
Control[{{m1,-2,""},-10,10,1,Appearance-> "Labeled"}],
PopupMenu[Dynamic[ineq1],{"<","≤",">","≥"}],
Button["shade blue",filling1=If[pt[[2]]>m1 (((pt[[1]]+h1))^2)+b1,Top,Bottom]]
},
{
"blue h",Control[{{h1,7,""},-10,10,1,Appearance-> "Labeled"}]
},
{
"blue k",Control[{{b1,7,""},-10,10,1,Appearance-> "Labeled"}]
},
{
"red a",
Control[{{m2,5,""},-10,10,1,Appearance-> "Labeled"}],
PopupMenu[Dynamic[ineq2],{"<","≤",">","≥"}],
Button["shade red",filling2=If[pt[[2]]>m2 (((pt[[1]]+h2))^2)+b2,Top,Bottom]]
},
{
"red h",Control[{{h2,-2,""},-10,10,1,Appearance-> "Labeled"}]
},
{
"red k",Control[{{b2,-2,""},-10,10,1,Appearance-> "Labeled"}]
}
}
],
{{filling1,None},{None,Top,Bottom},ControlType->None},
{{filling2,None},{None,Top,Bottom},ControlType->None},
{{showresult,False},{False,True},ControlType->None},
AutorunSequencing -> {1,2,3,4,5},ControlPlacement->{Top,Bottom,Top},(*LabelStyle->{14,"TraditionalForm"},*)TrackedSymbols->True]

Journal: Graph {({{y>2(((x-2))^2)-4}, {y > 2 (((x + 2))^2)-4}}) . Find a point that satisfies each of the following: a point that fits the whole system, just the first function, just the second function, and neither function.

Journal: Try graphing {({{y≤-(((x+3))^2)-2}, {y≥2x-3}})